package controllayer;

import java.util.ArrayList;

import modellayer.Customer;
import modellayer.CustomerContainer;

/**
 * The class CustomerCtrl is to take input from and perform the actions requested from the
 * GUI layer. These actions are performed on the classes CustomerContainer and Customer in the modellayer.
 * 
 * @author Stefan Bols 
 * @version 140114
 */
public class CustomerCtrl {
	private static CustomerCtrl instance;
	private CustomerContainer customerCon;
	
	private CustomerCtrl()
	{
		customerCon = CustomerContainer.getInstance();
	}
	
	public static CustomerCtrl getInstance()
	{
		if (instance==null) {
			instance = new CustomerCtrl();
		}
		
		return instance;
	}
	
	public Customer getCustomer(String customerNo)
	{
		return customerCon.getCustomer(customerNo);
	}
	
	public String createCustomer(String firstName, String lastName, String addressStreet, String addressCity, String addressZipcode, String phone, String email, boolean callBack)
	{
		return customerCon.createCustomer(firstName, lastName, addressStreet, addressCity, addressZipcode, phone, email, callBack);
	}
	
	public void createCustomer(String firstName, String lastName, String addressStreet, String addressCity, String addressZipcode, String phone, String email)
	{
		customerCon.createCustomer(firstName, lastName, addressStreet, addressCity, addressZipcode, phone, email);
	}
	
	public ArrayList<Customer> getCustomerArray()
	{
		return customerCon.getCustomerArray();
	}
	
	public boolean deleteCustomer(String customerNo)
	{
		return customerCon.deleteCustomer(customerNo);
	}
}
